<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>提问详情window</title>
		<link rel="stylesheet" text="text.css" href="../../css.api.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/base.css"/>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
	</head>
	<style>
		#main {
		padding-top: 66px;
		padding-left: 10px;
		padding-right: 10px;
		}
		.img_pic_style {
		max-width: 100%;
		}
		img
	</style>
	<body >
		<div class="base_style_color base_title_Immerse" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar base_title_position" >
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="title"></span>
			<a class="base_right_item base_hide_item"> </a>
		</div>
		<div id="main">
			<p class="base_black_grey base_title_font" id="content"></p>
			<div style="text-align: center;display:none;" id="div_img">
				<img src="../../image/course_placehoder.png" class="img_pic_style" id="qusestion_pic" />
			</div>
		</div>
		<div class="noSign" hidden="hidden" id="noData">
			<img src="../../image/icon_img.png" width="60%">
			<p class="font16 top_15 base_dark_grey" >
				老师端暂无设置问题
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript">
		apiready = function() {
			api.showProgress();
			setTimeout(function() {
				getdata();
			}, 300);
			sendBuriedNotifi('0', '学生端提问页', '180');
		};
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		//获取数据
		function getdata() {
			var params = {
				iid : api.pageParam.id,
				tid : 2
			}
			cfnetppPOST(url_ActiveInfo, params, true, function(data, status) {
				//				alert(JSON.stringify(data));
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						//					alert("44");
						setQusetionData(data.data);
					} else if (data.code = 108) {
						$('#noData').show();
						$('#noNet').hide();
						$('#mian').hide();
					} else {
						$('#noData').hide();
						$('#noNet').show();
						$('#mian').hide();
					}
				}
			})
		}

		function setQusetionData(data) {
			$('#title').text(data.name);
			if (data.upfile != '' && data.upfile != null) {
				$('#div_img').show()
				$('#qusestion_pic').attr('src', data.upfile);
				$("#qusestion_pic").click(function() {
					var imgArr = new Array();
					imgArr.push(data.upfile);
					showimg(imgArr, 0);
				});
			}
			var content = data.content + '';
			if (content != '' && content != null) {
				$('#content').text(content);
				$('#contentdiv').show();
			} else {
				if (data.upfile != '' && data.upfile != null) {
					$('#contentdiv').show();
				} else {
					$('#contentdiv').hide();
				}
			}
		}

		function backIndex() {
			sendBuriedNotifi('1', '学生端提问页', '180');
			api.closeWin({
			});
		}
	</script>
</html>